using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class UDF_PKT_COPYMap : EntityTypeConfiguration<UDF_PKT_COPY>
    {
        public UDF_PKT_COPYMap()
        {
            // Primary Key
            this.HasKey(t => new { t.ID, t.SPID, t.FieldType_ID });

            // Properties
            this.Property(t => t.ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.SPID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FieldType_ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("UDF_PKT_COPY");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.SPID).HasColumnName("SPID");
            this.Property(t => t.FieldType_ID).HasColumnName("FieldType_ID");
        }
    }
}
